<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.29
     from faq.tnf on 19 December 2010 -->

<TITLE>Frequently Asked Questions and Answers - How to solve common problems in Eli</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000" BACKGROUND="gifs/bg.gif">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0" VALIGN=BOTTOM>
<TR VALIGN=BOTTOM>
<TD WIDTH="160" VALIGN=BOTTOM>
<A HREF="http://eli-project.sourceforge.net/">
<IMG SRC="gifs/elilogo.gif" BORDER=0>
</A>&nbsp;
</TD>
<TD WIDTH="25" VALIGN=BOTTOM>
<img src="gifs/empty.gif" WIDTH=25 HEIGHT=25>
</TD>
<TD ALIGN=LEFT WIDTH="475" VALIGN=BOTTOM>
<A HREF="index.html"><IMG SRC="gifs/title.png" BORDER=0></A>
</TD>
<!-- |DELETE FOR SOURCEFORGE LOGO|
<TD>
<a href="http://sourceforge.net/projects/eli-project">
<img
  src="http://sflogo.sourceforge.net/sflogo.php?group_id=70447&amp;type=13"
  width="120" height="30"
  alt="Get Eli: Translator Construction Made Easy at SourceForge.net.
    Fast, secure and Free Open Source software downloads"/>
</a>
</TD>
|DELETE FOR SOURCEFORGE LOGO| -->
</TR>
</TABLE>

<HR size=1 noshade width=785 align=left>
<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0>
<TR>
<TD VALIGN=TOP WIDTH="160">
<h4>General Information</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="index.html">Eli: Translator Construction Made Easy</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="gindex_1.html#SEC1">Global Index</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="faq_toc.html" >Frequently Asked Questions</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Tutorials</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="EliRefCard_toc.html">Quick Reference Card</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="novice_toc.html">Guide For new Eli Users</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="news_toc.html">Release Notes of Eli</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="nametutorial_toc.html">Tutorial on Name Analysis</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="typetutorial_toc.html">Tutorial on Type Analysis</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Reference Manuals</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ui_toc.html">User Interface</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="pp_toc.html">Eli products and parameters</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lidoref_toc.html">LIDO Reference Manual</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ee.html" >Typical Eli Usage Errors</a> </td></tr>
</table>

<h4>Libraries</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lib_toc.html">Eli library routines</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="modlib_toc.html">Specification Module Library</a></td></tr>
</table>

<h4>Translation Tasks</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lex_toc.html">Lexical analysis specification</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="syntax_toc.html">Syntactic Analysis Manual</a></td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="comptrees_toc.html">Computation in Trees</a></td></tr>
</table>

<h4>Tools</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="lcl_toc.html">LIGA Control Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="show_toc.html">Debugging Information for LIDO</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="gorto_toc.html">Graphical ORder TOol</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="fw_toc.html">FunnelWeb User's Manual</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="ptg_toc.html">Pattern-based Text Generator</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="deftbl_toc.html">Property Definition Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="oil_toc.html">Operator Identification Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="tp_toc.html">Tree Grammar Specification Language</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="clp_toc.html">Command Line Processing</a> </td></tr>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="cola_toc.html">COLA Options Reference Manual</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="idem_toc.html">Generating Unparsing Code</a> </td></tr>
</table>
<p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="mon_toc.html">Monitoring a Processor's Execution</a> </td></tr>
</table>

<h4>Administration</h4>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top><td><img src="gifs/gelbekugel.gif" WIDTH=7 HEIGHT=7 ALT=" o"> </td><td><a href="sysadmin_toc.html">System Administration Guide</a> </td></tr>
</table>

<HR WIDTH="100%">
<A HREF="mailto:eli-project-users@lists.sourceforge.net">
<IMG SRC="gifs/button_mail.gif" BORDER=0 ALIGN="left"></A>
<A HREF="index.html"><IMG SRC="gifs/home.gif" BORDER=0 ALIGN="right"></A>

</TD>
<TD VALIGN=TOP WIDTH="25"><img src="gifs/empty.gif" WIDTH=25 HEIGHT=25></TD>

<TD VALIGN=TOP WIDTH="600">
<H1>Frequently Asked Questions and Answers</H1>
<P>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_3.html"><IMG SRC="gifs/prev.gif" ALT="Previous Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_5.html"><IMG SRC="gifs/next.gif" ALT="Next Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_toc.html"><IMG SRC="gifs/up.gif" ALT="Table of Contents" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT="">
<HR size=1 noshade width=600 align=left>
<H1><A NAME="SEC16" HREF="faq_toc.html#SEC16">How to solve common problems in Eli</A></H1>
<P>
<hr>
<P>
<H2><A NAME="SEC17" HREF="faq_toc.html#SEC17">Is there Support for Intermediate Code in Eli?</A></H2>
<P>
<PRE>
&#62; Does Eli support the generation of intermediate code and if so, what
&#62; type of code and in which way?
</PRE>
<P>
In general, Eli supports generation of intermediate code in the same
way that it supports the generation of any kind of code:  You write a PTG
specification of the language to be output and invoke the routines to
build up your output.
<P>
If you want to specify the intermediate language as a tree and perform
some attribute computation over it without writing it out and reading it
back in, then you can specify the tree in LIDO.  Eli produces Mk
functions from a LIDO specification much the same way as it produces PTG
functions from a specification.
You invoke the Mk functions to build your tree and then
paste it into the original tree built by the parser. See  <A HREF="lidoref_10.html#SEC18">Computed Subtrees of LIDO - Reference Manual</A>, for
details.  You can see an example using an intermediate language
appropriate to the Spim simulator for the MIPS at
<A HREF="http://ece-www.colorado.edu/~ecen4553/HW/ctgt.html">http://ece-www.colorado.edu/~ecen4553/HW/ctgt.html</A>.
<P>
If you want to target an existing intermediate representation that is
implemented as a class library (like
<A HREF="http://suif.stanford.edu/suif/suif.html">Suif</A>,
for example), then you make the
class library available as a part of your specification (usually via a .a
file) and invoke its methods directly from your translation specification
just like you would invoke PTG or Mk functions.
<P>
<hr>
<P>
<H2><A NAME="SEC18" HREF="faq_toc.html#SEC18">C++</A></H2>
<P>
<PRE>
&#62;   Is there an ELI-generated compiler available for C++?
</PRE>
<P>
There is none that I know of.  One reason is that C++ seems to be defined
not by a standard but by a collection of front ends.  Particular users are
partial to particular front ends, and are not interested in a compiler that
actually conforms to either the ARM or the draft ANSI standard.  This
situation might change, but in the interim there seems to be little point
in building an Eli specification.
<P>
Compounding the problem is the fact that C++ has a number of essential
ambiguities that make it very difficult to specify formally.  For example,
if something looks like both a declaration and an expression then it's a
declaration.  How do you express that formally?
<P>
<hr>
<P>
<H2><A NAME="SEC19" HREF="faq_toc.html#SEC19">How does recognition of delimiters work in Eli?</A></H2>
<P>
<PRE>
&#62; I want to use ':=' in the grammar to represent three notations
&#62; ':=', '=', and ':-'.
</PRE>
<P>
This could be done as follows
(for an explanation of all of the relevant constructs,
see  <A HREF="lex_4.html#SEC20">Literal Symbols of Lexical Analysis</A>):
<P>
<PRE>
@O@&#60;foo.con@&#62;==@{
S: 'A' ':=' 'B' .
@}

@O@&#60;foo.delit@&#62;==@{
$:=     ColonEqual
@}

@O@&#60;foo.gla@&#62;==@{
        $:=     [mkassign]
        $=      [mkassign]
        $:-     [mkassign]
@}

@O@&#60;foo.c@&#62;==@{
#include "litcode.h"
#include "eliproto.h"

void
#if PROTO_OK
mkassign(char *c, int l, int *t, int *s)
#else
mkassign(c, l, t, s) char *c; int l, *t; int *s;
#endif
{ *t = ColonEqual; }
@}
</PRE>
<P>
<hr>
<P>
<PRE>
&#62; For Pascal, <CODE>:kwd</CODE> has to be applied to the file that contains
&#62; nothing else than the specification of <CODE>Name: PASCAL_IDENTIFIER</CODE>
&#62; Is that the only possible application of <CODE>:kwd</CODE>?
</PRE>
<P>
The <CODE>:kwd</CODE> derivation is used to specify sets of literal terminals
appearing in a grammar that should be recognized by looking them up in the
identifier table rather than by incorporating them into the scanner's
finite state machine.
Mixed-case keywords are the most common use of <CODE>:kwd</CODE>, but it can also
be used simply to cut down the size of the scanner tables at some cost in
execution time.
<P>
<hr>
<P>
<H2><A NAME="SEC20" HREF="faq_toc.html#SEC20">How can I use external libraries with Eli?</A></H2>
<P>
Use <CODE>+lib='mylib'</CODE> to add the <SAMP>`-lmylib'</SAMP>' option to the link. <CODE>+lib_sp</CODE>
can be used to supply a directory for the library (the <CODE>-L</CODE> option in
the link).
<P>
You can also use the mechanism used by Eli internally, although it
isn't really pretty.  You can add a <TT>`.libs'</TT> file to your specification
that has something of the form:
<P>
<PRE>
   / +lib_sp=(libdir) +lib='libname' :library_flags
</PRE>
<P>
<hr>
<P>
&#62; Is there also a way to tell Eli an include path for
&#62; header files?
<P>
There is a parameter called +cc_flags with which you can provide
the <CODE>-I</CODE> option to the compilation.
<P>
<hr>
<P>
<HR size=1 noshade width=600 align=left>
<P>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_3.html"><IMG SRC="gifs/prev.gif" ALT="Previous Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_5.html"><IMG SRC="gifs/next.gif" ALT="Next Chapter" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT=""><A HREF="faq_toc.html"><IMG SRC="gifs/up.gif" ALT="Table of Contents" BORDER="0"></A>
<IMG SRC="gifs/empty.gif" WIDTH=25 HEIGHT=25 ALT="">
<HR size=1 noshade width=600 align=left>
</TD>
</TR>
</TABLE>

</BODY></HTML>
